import java.awt.Color;


public class Ball {

	private double x, y, vx, vy, r, direction, gravity, mass;
	
	public Ball(double xPos, double yPos, double xVel, double yVel, double radius, double gravity){
		this.x = xPos;
		this.y = yPos;
		this.vx = xVel;
		this.vy = yVel;
		this.r = radius;
		this.gravity = gravity;
		
		this.mass = Math.PI*radius*radius;
		
		this.direction = 1;
	}

	public double getMass(){
		return mass;
	}
	
	public double getR(){
		return r;
	}
	
	public double getVx() {
		return vx;
	}

	public void setVx(double vx) {
		this.vx = vx;
	}

	public double getVy() {
		return vy;
	}

	public void setVy(double vy) {
		this.vy = vy;
	}

	public double getX() {
		return x;
	}

	public void setX(double x) {
		this.x = x;
	}

	public double getY() {
		return y;
	}

	public void setY(double y) {
		this.y = y;
	}
	
	public double getDirection() {
		return direction;
	}

	public void setDirection(double direction) {
		this.direction = direction;
	}

	public void move(double deltaT){
		setVy(getVy() + gravity);
		
		this.setX(getX() + getVx()*deltaT);
		this.setY(getY() + getVy()*deltaT);
	}
	
	public double getTotalSpeed(){
		double speed;
		speed = Math.sqrt((getVx()*getVx()) + (getVy()*getVy()));
		return speed;
	}
}
